package sng.modules.view.components.city.logic.building
{
	import sng.modules.model.vo.UserBuildingVO;
	import sng.modules.view.components.city.logic.City;
	import sng.modules.view.components.city.logic.CityView;
	import sng.modules.view.components.city.logic.unit.BaseBuilding;
	
	public class BuildingCreator
	{
		public static const HOUSE		:uint =  0;
		public static const BUSINESS	:uint =  1;
		public static const FACTORY	:uint =  2;
		public static const FARM		:uint =  3;
		public static const WAREHOUSE	:uint =  4;
		
		public function addBuilding(_bVO:UserBuildingVO, container:CityView, col:int, row:int,_city:City,zeroHeight:Boolean=false):BaseBuilding 
		{
			var building:BaseBuilding = this.createBuilding(_bVO, container,_city);
			container.groundScene.addTile(building, col, row,container, zeroHeight); // add the sprite to the container
			return building;
		}
		
		/**
		 * 工厂方法
		 * @param 建筑类型
		 * @return 该类型的建筑实例
		 * 
		 */		
		private function createBuilding(_bVO:UserBuildingVO, _view:CityView,_city:City):BaseBuilding 
		{
			return new BaseBuilding(_bVO, _view,_city,null);
		}
	}
}